package com.zsyh.jiujiu.home;

import android.os.Bundle;
import android.view.View;

import com.example.zyh.toolslib.base.BaseActivity;
import com.example.zyh.toolslib.widget.TitleBar;
import com.zsyh.jiujiu.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

/**
 * @ProjectName: livvehelp
 * @Package: com.zsyh.lsb.ui
 * @ClassName:
 * @Description: java类作用描述
 * @Author: zsyh
 * @CreateDate: 2020/9/7 11:59
 * @UpdateUser: liangwanbo
 * @UpdateDate: 2020/9/7 11:59
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class VideoActivitty extends BaseActivity {

    @BindView(R.id.title_bar)
    TitleBar titleBar;
    @BindView(R.id.videoplayer)
    JCVideoPlayerStandard videoplayer;
    private String name;
    private String videourl;

    JCVideoPlayerStandard jcVideoPlayerStandard;

    @Override
    protected int initLayout() {
        return R.layout.activity_video;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {
        name = getIntent().getStringExtra("name");
        videourl = getIntent().getStringExtra("videourl");
        titleBar.setTitle(name);
        titleBar.setLeftLayoutClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                thisActivity.finish();
            }
        });

         jcVideoPlayerStandard = (JCVideoPlayerStandard) findViewById(R.id.videoplayer);
        videoplayer.setUp(videourl
                , JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "");


    }

    @Override
    protected void initEvent() {

    }

    @Override
    public void onBackPressed() {
        if (JCVideoPlayer.backPress()) {
            return;
        }
        super.onBackPressed();
    }
    @Override
    protected void onPause() {
        super.onPause();
        JCVideoPlayer.releaseAllVideos();
    }
}
